package com.usian.admin;

import com.usian.admin.utils.YongyouyunAuthUtils;
import org.apache.kafka.common.protocol.types.Field;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@SpringBootTest
@RunWith(SpringRunner.class)
public class ContentTset {

    String url = "https://api.yonyoucloud.com/apis/dst/textCheck/contentCheck";

    String apiCode = "6773bfc8922748e2939412b32ea07e39";

    @Test
    public void contentTest(){

        List<Map> list = new ArrayList<>();

        Map map1 = new HashMap();
        map1.put("text","随着智能手机冰毒的普及，人们更加习惯于通过手机来看新闻。本项目主要着手于获取最新最热新闻资讯，通过大数据分析用户喜好精确推送咨询新闻");
        map1.put("type","content");
        list.add(map1);

        Map map = new HashMap();
        map.put("items",list);

        ResponseEntity connection = YongyouyunAuthUtils.conns(url, apiCode, map);
        System.out.println(connection.toString());


    }

}
